package p270jp.pxv.android.legacy.model;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import p270jp.pxv.android.legacy.model.DaoMaster;

/* renamed from: jp.pxv.android.legacy.model.PixivOpenHelper */
/* loaded from: classes2.dex */
public class PixivOpenHelper extends DaoMaster.OpenHelper {
    public PixivOpenHelper(Context context, String str, SQLiteDatabase.CursorFactory cursorFactory) {
        super(context, str, cursorFactory);
    }

    @Override // android.database.sqlite.SQLiteOpenHelper
    public void onUpgrade(SQLiteDatabase sQLiteDatabase, int i, int i2) {
        if (i < 3) {
            DaoMaster.dropAllTables(sQLiteDatabase, true);
            onCreate(sQLiteDatabase);
        } else if (i == 3) {
            sQLiteDatabase.execSQL("ALTER TABLE LIKED_WORK ADD COLUMN LOGGED_IN_USER_ID INTEGER DEFAULT 0");
        }
    }
}
